In general, an optical sensor is known which detects movement of a detection object such as a finger or a hand by using a light emitting element and a light receiving element (see, e.g., Patent Document 1 and Non Patent Document 1). Such an optical sensor according to the related art is provided with three light emitting elements surrounding one light receiving element. In the optical sensor, reflected light from a detection object is received for each of the three light emitting elements, and movement of the detection object is detected on the basis of the phase differences among the three reflected lights.    Patent Document 1: Japanese Unexamined Patent Application Publication No. 2011-227574    Non Patent Document 1: “Silicon Labs AN580”, [online], Internet <URL: http://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/TechnicalDocs/AN580.pdf&src=DocumentationWebPart>
In the optical sensor described in the Patent Document 1, each of rise times at which the three reflected lights become larger than a predetermined threshold or each of fall times at which the three reflected light becomes smaller than a predetermined threshold is detected, and phase differences are obtained on the basis of the time differences among the rise times or the fall times. In the optical sensor described in Non Patent Document 1, each of the peaks of waveforms of the three reflected light is detected, and phase differences are obtained on the basis of the time differences among the peaks. However, in these methods, when waveforms of three currents flowing through a light receiving element are different from each other, it is not possible to accurately obtain phase differences among reflected light, and false detection of a movement direction occurs.